package com.yloveg.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections4.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.yloveg.base.BaseController;
import com.yloveg.common.PageUtil;
import com.yloveg.entity.SPermission;
import com.yloveg.entity.SPermissionExtend;
import com.yloveg.entity.SRole;
import com.yloveg.entity.SRolePermission;
import com.yloveg.entity.SUserRole;
import com.yloveg.entity.Suser;
import com.yloveg.entity.UserInfo;
import com.yloveg.entity.VComplain;
import com.yloveg.entity.VGift;
import com.yloveg.service.SPermissionService;
import com.yloveg.service.SRolePermissionService;
import com.yloveg.service.SRoleService;
import com.yloveg.service.SUserRoleService;
import com.yloveg.service.UserInfoService;
import com.yloveg.service.UserService;
import com.yloveg.service.VComplainService;
import com.yloveg.service.VGiftService;
import com.yloveg.service.VVisitorLogService;

import net.sf.json.JSONObject;


@Controller
@RequestMapping({"baseset"})  
public class BaseSetController extends BaseController {  
	
	@Autowired
    private VComplainService vComplainService;

	@Autowired
    private VVisitorLogService vVisitorLogService;
	
	@RequestMapping("/complainList")
    public String complainList(ModelMap map){
    	 return "landing/baseset/complainList";
    }
	
	@RequestMapping("/queryComplainPage")
    @ResponseBody
    public Map<String, Object> queryComplainPage(int page, int limit){
		PageInfo<VComplain> pageList=vComplainService.queryComplainPage(page, limit);
        Map<String, Object> map = PageUtil.dateToLayTable(pageList);
        return map;
    }
	
	@RequestMapping("/visitorList")
    public String visitorList(ModelMap map){
    	 return "landing/baseset/visitorList";
    }

	@RequestMapping("/queryVisitorPage")
    @ResponseBody
    public Map<String, Object> queryVisitorPage(int page, int limit){
        Map<String, Object> map = PageUtil.dateToLayTable(vVisitorLogService.queryVisitorPage(page, limit));
        return map;
    }
}
